package com.hnkywl.sts.entity.xsgl;

import com.hnkywl.sts.entity.BaseEntity;
import com.hnkywl.sts.entity.cggl.Glfy;
import com.hnkywl.sts.entity.jhgl.Bgjhhzmx;
import com.hnkywl.sts.entity.organ.Ck;
import com.hnkywl.sts.entity.organ.Gsjg;
import com.hnkywl.sts.entity.organ.Nbgs;
import com.hnkywl.sts.entity.sys.Yg;
import org.hibernate.annotations.Cascade;
import org.hibernate.annotations.Where;

import javax.persistence.*;
import java.util.Date;
import java.util.List;

/**
 * 说明：转库单
 * 包:        com.hnkywl.sts.entity.xsgl
 * 类描述:    转库单
 * 修改备注: [说明本次修改内容]
 * 版本:        [v1.0]
 */
@Entity
@Table(name = "T_BIZ_ZKD")
@Where(clause = "deleted!='1'")
public class Zkd extends BaseEntity {
    @Id
    @SequenceGenerator(name = "seqZkd", allocationSize = 1, sequenceName = "SEQ_BIZ_ZKD")
    @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "seqZkd")
    private Long id;
    /**
     * 保供计划汇总明细
     */
    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "BGJHHZMX_ID")
    private Bgjhhzmx bgjhhzmx;

    /**
     * 转库单号
     */
    private String zkdh;
    /**
     * 转出日期
     */
    private Date zkrq;

    /**
     * 转入日期
     */
    private Date zrrq;

    /**
     * 配送单
     */
    @OneToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "PSD_ID")
    private Psd psd;

    /**
     * 出库人
     */
    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "CKR_ID")
    private Yg ckr;


    /**
     * 申请公司
     */
    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "SQGS_ID")
    private Nbgs sqgs;

    /**
     * 转出仓库
     */
    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "ZCCK_ID")
    private Ck zcck;

    /**
     * 转入仓库
     */
    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "ZRCK_ID")
    private Ck zrck;

    /**
     * 状态  ' bgzk '保供转库   'zczk'正常转库
     */
    private String type;

    /**
     * 需要配送 1true0false
     */
    private Boolean xyps = false;

    /**
     * 需要验收 1true0false
     */
    private Boolean xyys = false;

    /**
     * 转库单明细
     */
    @OneToMany(fetch = FetchType.LAZY, targetEntity = Zkdmx.class)
    @Cascade({org.hibernate.annotations.CascadeType.SAVE_UPDATE})
    @JoinColumn(name = "ZKD_ID")
    @Where(clause = "deleted!='1'")
    private List<Zkdmx> zkdmxList;

    @OneToMany(fetch = FetchType.LAZY, targetEntity = Glfy.class)
    @Cascade({org.hibernate.annotations.CascadeType.SAVE_UPDATE})
    @JoinColumn(name = "ZKD_ID")
    @Where(clause = "deleted!='1'")
    private List<Glfy> zkfyList;

    /**
     * 状态判断已保存 zt='ybc',zt='ytj',zt='ysp',zt='yzk'
     */
    private String zt;

    /**
     * 是否配送 1true0false
     */
    private Boolean yps = false;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Date getZrrq() {
        return zrrq;
    }

    public void setZrrq(Date zrrq) {
        this.zrrq = zrrq;
    }

    public Yg getCkr() {
        return ckr;
    }

    public void setCkr(Yg ckr) {
        this.ckr = ckr;
    }

    public String getZkdh() {
        return zkdh;
    }

    public void setZkdh(String zkdh) {
        this.zkdh = zkdh;
    }

    public Boolean getYps() {
        return yps;
    }

    public void setYps(Boolean yps) {
        this.yps = yps;
    }

    public Psd getPsd() {
        return psd;
    }

    public void setPsd(Psd psd) {
        this.psd = psd;
    }

    public Bgjhhzmx getBgjhhzmx() {
        return bgjhhzmx;
    }

    public void setBgjhhzmx(Bgjhhzmx bgjhhzmx) {
        this.bgjhhzmx = bgjhhzmx;
    }

    public Date getZkrq() {
        return zkrq;
    }

    public void setZkrq(Date zkrq) {
        this.zkrq = zkrq;
    }

    public Nbgs getSqgs() {
        return sqgs;
    }

    public void setSqgs(Nbgs sqgs) {
        this.sqgs = sqgs;
    }

    public Ck getZcck() {
        return zcck;
    }

    public void setZcck(Ck zcck) {
        this.zcck = zcck;
    }

    public Ck getZrck() {
        return zrck;
    }

    public void setZrck(Ck zrck) {
        this.zrck = zrck;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public Boolean getXyps() {
        return xyps;
    }

    public void setXyps(Boolean xyps) {
        this.xyps = xyps;
    }

    public Boolean getXyys() {
        return xyys;
    }

    public void setXyys(Boolean xyys) {
        this.xyys = xyys;
    }

    public List<Zkdmx> getZkdmxList() {
        return zkdmxList;
    }

    public void setZkdmxList(List<Zkdmx> zkdmxList) {
        this.zkdmxList = zkdmxList;
    }

    public String getZt() {
        return zt;
    }

    public void setZt(String zt) {
        this.zt = zt;
    }

    public List<Glfy> getZkfyList() {
        return zkfyList;
    }

    public void setZkfyList(List<Glfy> zkfyList) {
        this.zkfyList = zkfyList;
    }
}
